/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.irssproject.app.entitats.recommendations;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author adria
 */
@Embeddable
public class TopicSubscriptionPK implements Serializable {

    @Basic(optional = false)
    @Column(name = "idUser")
    private long idUser;
    @Basic(optional = false)
    @Column(name = "idTopic_subscribed")
    private long idTopic_subscribed;

    public TopicSubscriptionPK() {
    }

    public TopicSubscriptionPK(long idUser, long idTopic_subscribed) {
        this.idUser = idUser;
        this.idTopic_subscribed = idTopic_subscribed;
    }

    public long getIdUser() {
        return idUser;
    }

    public void setIdUser(long idUser) {
        this.idUser = idUser;
    }

    public long getIdTopic_subscribed() {
        return idTopic_subscribed;
    }

    public void setIdTopic_subscribed(long idTopic_subscribed) {
        this.idTopic_subscribed = idTopic_subscribed;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (long) idUser;
        hash += (long) idTopic_subscribed;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TopicSubscriptionPK)) {
            return false;
        }
        TopicSubscriptionPK other = (TopicSubscriptionPK) object;
        if (this.idUser != other.idUser) {
            return false;
        }
        if (this.idTopic_subscribed != other.idTopic_subscribed) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.irssproject.app.entitats.TopicSubscriptionPK[idUser=" + idUser + ", idTopic_subscribed=" + idTopic_subscribed + " ]";
    }
}